<template>
	<view>
		<u-navbar title="我的钱包" :border-bottom='false' back-icon-size='48'>
			<view slot='right' style="padding-right: 28rpx;font-size: 28rpx;" @click="navTo('./detail/detail')">
				钱包明细
			</view>
		</u-navbar>
		<view class="mian">
			<view class="total">
				<view class="title">
					我的钱包
				</view>
				<view class="num">
					{{userMoney}}
				</view>
			</view>
			<view class="btns">
				<view class="btns-li" @click="navTo('../recharge/recharge')">
					<view class="left">
						<image src="../../../static/imgs/woyaocz.png" mode=""></image>
						<text>我要充值</text>
					</view>
					<view class="right">
						<u-icon name="arrow-right" color="#666666" size="28"></u-icon>
					</view>
				</view>
				<view class="btns-li" @click="navTo('../withdraw/withdraw')">
					<view class="left">
						<image src="../../../static/imgs/woyaotx.png" mode=""></image>
						<text>我要提现</text>
					</view>
					<view class="right">
						<u-icon name="arrow-right" color="#666666" size="28"></u-icon>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import myRequest from '@/api/index.js'
	export default {
		data() {
			return {
				userMoney: '',
			}
		},
		onShow() {
			this.getWallet()
		},
		methods: {
			async getWallet() {
				let res = await myRequest.getMywallet({
					page: '1'
				})
				if (res.status) {
					this.userMoney = res.user_money
				}
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mian {
		padding: 20rpx;
		
		.total {
			width: 100%;
			height: 316rpx;
			border-radius: 16rpx;
			@include bgi('../../../static/imgs/wodeqbbgi.png');

			.title {
				padding-top: 96rpx;
				width: 100%;
				text-align: center;
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #4D3102;
			}

			.num {
				margin-top: 20rpx;
				width: 100%;
				text-align: center;
				font-size: 30px;
				font-family: Arial;
				font-weight: 400;
				color: #4D3102;
			}
		}
		
		.btns {
			margin-top: 40rpx;
			.btns-li{
				margin-bottom: 12rpx;
				width: 710rpx;
				height: 100rpx;
				background: #FFFFFF;
				border-radius: 16rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 20rpx;
				.left{
					display: flex;
					align-items: center;
					image {
						width: 48rpx;
						height: 48rpx;
					}
					text {
						margin-left: 20rpx;
						font-size: 32rpx;
						font-family: PingFangSC-Medium;
						color: #333333;
					}
				}
			}
		}
	}
</style>
